import request from '@/utils/request'


// 查询仓库信息 下拉框
export function warehouseShow() {
  return request({
    url: '/xiaocui/procurement/warehouseList',
    method: 'get',
  })
}

// 查询采购需求申请列表
export function listProcurement(query) {
  return request({
    url: '/xiaocui/procurement/list',
    method: 'get',
    params: query
  })
}

// 查询采购需求申请详细
export function getProcurement(id) {
  return request({
    url: '/xiaocui/procurement/' + id,
    method: 'get'
  })
}

// 新增采购需求申请
export function addProcurement(data) {
  return request({
    url: '/xiaocui/procurement',
    method: 'post',
    data: data
  })
}

// 修改采购需求申请
export function updateProcurement(data) {
  return request({
    url: '/xiaocui/procurement',
    method: 'put',
    data: data
  })
}

// 删除采购需求申请
export function delProcurement(id) {
  return request({
    url: '/xiaocui/procurement/' + id,
    method: 'delete'
  })
}

//合并采购申请表
export function MergeProcurement(id) {
  return request({
    url: '/xiaocui/procurement/' + id,
    method: 'post'
  })
}
export function getPurchase() {
  return request({
    url: '/xiaocui/procurement/purchaseList',
    method: 'get'
  })
}

/**
 * 后台传ids 进行新建申请单
 *
 */

export function addPurchase(data) {
  return request({
    url: '/xiaocui/procurement/addPurchase',
    method: 'post',
    data
  })
}
